
Page({
  data: {
    num: 1,
    list: []
  },

  toDetail () {
    wx.navigateTo({
      url: '/pages/detail/detail'
    })
  },
  changeNum (e) { 
    console.log(e.target.dataset.num);
    this.setData({
      num: e.target.dataset.num
    })
  },                                                                                                                 

    
  onLoad(options) {

  },

    
  onReady() {

  },

    
  onShow() {
    let that = this
    wx.request({
      url: 'http://localhost:3000/data',
      success (res) {
        that.setData({
          list: res.data.hot
        })
      }
    })
  },

    
  onHide() {

  },

    
  onUnload() {

  },

    
  onPullDownRefresh() {

  },

    
  onReachBottom() {

  },

    
  onShareAppMessage() {

  }
})